package com.wk.wms.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redis分布式锁配置
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonclient(){
        /* 连接非本地的Redis
        Config config = new Config();
        // 可以用"rediss://"来启用SSL连接
        config.useSingleServer().setAddress("redis://172.0.0.1:6379");
        return Redisson.create(config);*/

        //默认连接本地Redis
        return Redisson.create();
    }

}
